﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.StaticBatchingUtility
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using Unity.Profiling;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>StaticBatchingUtility can prepare your objects to take advantage of Unity's static batching.</para>
  /// </summary>
  public sealed class StaticBatchingUtility
  {
    internal static ProfilerMarker s_CombineMarker = new ProfilerMarker("StaticBatching.Combine");
    internal static ProfilerMarker s_SortMarker = new ProfilerMarker("StaticBatching.SortObjects");
    internal static ProfilerMarker s_MakeBatchMarker = new ProfilerMarker("StaticBatching.MakeBatch");

    /// <summary>
    ///   <para>Combines all children GameObjects of the staticBatchRoot for static batching.</para>
    /// </summary>
    /// <param name="staticBatchRoot">The GameObject that should become the root of the combined batch.</param>
    public static void Combine(GameObject staticBatchRoot)
    {
      using (StaticBatchingUtility.s_CombineMarker.Auto())
        InternalStaticBatchingUtility.CombineRoot(staticBatchRoot, (InternalStaticBatchingUtility.StaticBatcherGOSorter) null);
    }

    /// <summary>
    ///   <para>Combines all GameObjects in gos for static batching and treats staticBatchRoot as the root.</para>
    /// </summary>
    /// <param name="gos">The GameObjects to prepare for static batching.</param>
    /// <param name="staticBatchRoot">The GameObject that should become the root of the combined batch.</param>
    public static void Combine(GameObject[] gos, GameObject staticBatchRoot)
    {
      using (StaticBatchingUtility.s_CombineMarker.Auto())
        InternalStaticBatchingUtility.CombineGameObjects(gos, staticBatchRoot, false, (InternalStaticBatchingUtility.StaticBatcherGOSorter) null);
    }
  }
}
